package com.ruoyi.service.towComp.impl;


import com.ruoyi.mapper.towComp.PersonnelMapper;
import com.ruoyi.service.towComp.PersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class PersonnelServiceImpl implements PersonnelService {

    @Autowired
    PersonnelMapper personnelMapper;

    @Override
    public List<Map<String, Object>> findPersonnel(Map map) {
        return personnelMapper.findPersonnel(map);
    }

    @Override
    public int add(Map map) {
        return personnelMapper.add(map);
    }

    @Override
    public int edit(Map map) {
        return personnelMapper.edit(map);
    }

    @Override
    public Map<String, Object> findPersonnelById(String id) {
        return personnelMapper.findPersonnelById(id);
    }

    @Override
    public int remove(String ids) {
        String[] idSplit = ids.split(",");
        int num = 0;
        for (String id : idSplit) {
            num += personnelMapper.removeData(id);
        }
        return num;
    }
}
